﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;

using ALE_Server.EC;

namespace ALE_Server.Plugin
{
    public abstract class Notifier
    {
        protected Uri m_Uri;

        public Notifier(string uri)
        {
            m_Uri = new Uri(uri);
            Init(uri);
        }

        public abstract void Init(string uri);
        public abstract void NotifySubscriber(ECReports reports);
        public abstract string GetURIFromFields();

        protected void WriteToOutputStream(ECReports reports, Stream stream)
        {
            XmlSerializer Serializer = new XmlSerializer(typeof(ECReports));

            Serializer.Serialize(stream, reports);
        }                   
    }
}
